import { parse } from 'querystring';
import pathRegexp from 'path-to-regexp';
import { Route } from '@/models/connect';
import { history } from 'umi';
import { Modal } from 'antd';
/* eslint no-useless-escape:0 import/prefer-default-export:0 */
const reg = /(((^https?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)$/;

export const isUrl = (path: string): boolean => reg.test(path);

export const isAntDesignPro = (): boolean => {
  if (ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION === 'site') {
    return true;
  }
  return window.location.hostname === 'preview.pro.ant.design';
};

// 给官方演示站点用，用于关闭真实开发环境不需要使用的特性
export const isAntDesignProOrDev = (): boolean => {
  const { NODE_ENV } = process.env;
  if (NODE_ENV === 'development') {
    return true;
  }
  return isAntDesignPro();
};

export const getPageQuery = () => parse(window.location.href.split('?')[1]);

/**
 * props.route.routes
 * @param router [{}]
 * @param pathname string
 */
export const getAuthorityFromRouter = <T extends Route>(
  router: T[] = [],
  pathname: string,
): T | undefined => {
  const authority = router.find(
    ({ routes, path = '/', target = '_self' }) =>
      (path && target !== '_blank' && pathRegexp(path).exec(pathname)) ||
      (routes && getAuthorityFromRouter(routes, pathname)),
  );
  if (authority) return authority;
  return undefined;
};

export const getRouteAuthority = (path: string, routeData: Route[]) => {
  let authorities: string[] | string | undefined;
  routeData.forEach((route) => {
    // match prefix
    if (pathRegexp(`${route.path}/(.*)`).test(`${path}/`)) {
      if (route.authority) {
        authorities = route.authority;
      }
      // exact match
      if (route.path === path) {
        authorities = route.authority || authorities;
      }
      // get children authority recursively
      if (route.routes) {
        authorities = getRouteAuthority(path, route.routes) || authorities;
      }
    }
  });
  return authorities;
};

export const checkSystem = () => {
  var userAgentInfo = navigator.userAgent;
  var Agents = new Array('Android', 'iPhone', 'SymbianOS', 'Windows Phone', 'iPad', 'iPod');
  var flag = true;
  for (var v = 0; v < Agents.length; v++) {
    if (userAgentInfo.indexOf(Agents[v]) > 0) {
      flag = false;
      break;
    }
  }
  return flag;
};

export const logOut = () => {
  localStorage.removeItem('antd-pro-authority');
  localStorage.removeItem('id');
  localStorage.removeItem('id_number');
  localStorage.removeItem('length');
  localStorage.removeItem('logintime');
  localStorage.removeItem('name');
  localStorage.removeItem('subjects');
  localStorage.removeItem('timestamp');
  localStorage.removeItem('type');
  localStorage.removeItem('userinfo');
  localStorage.setItem('remember_me', 'false');
};

export const dev = process.env.NODE_ENV === 'development' ? '/' : '/pc/index.html';

export const stopActive = (submit: any) => {
  let chance = 4;
  window.document.oncontextmenu = function () {
    event.returnValue = false;
  };
  window.document.onselectstart = function () {
    event.returnValue = false;
  };
  window.history.pushState(null, null, document.URL);
  window.addEventListener('popstate', function () {
    window.history.pushState(null, null, document.URL);
  });
  window.onkeydown = function (e) {
    if (
      e.altKey &&
      (e.keyCode === 37 || //屏蔽 Alt+ 方向键 ←
        e.keyCode === 39)
    ) {
      //屏蔽 Alt+ 方向键 →
      alert('不准你使用ALT+方向键前进或后退网页！');
      e.returnValue = false;
    }
    if (e.keyCode === 123) {
      e.returnValue = false;
    }
    if (
      e.keyCode === 116 || //屏蔽 F5 刷新键
      e.keyCode === 112 || //屏蔽 F1 刷新键
      e.keyCode === 27 ||
      (e.ctrlKey && e.keyCode === 82)
    ) {
      //Ctrl + R
      e.returnValue = false;
    }
    if (e.ctrlKey && e.keyCode === 78)
      //屏蔽 Ctrl+N
      e.returnValue = false;
    if (e.shiftKey && e.keyCode === 121)
      //屏蔽 shift+F10
      e.returnValue = false;
    if (e.srcElement.tagName === 'A' && e.shiftKey) e.returnValue = false; //屏蔽 shift 加鼠标左键新开一网页
    if (e.altKey && e.keyCode === 115) {
      //屏蔽Alt+F4
      alert('禁止关闭页面');
      return false;
    }
    if (e.keyCode === 18 || e.keyCode === 91 || e.keyCode === 92) {
      //屏蔽非法键
      e.returnValue = false;
    }
  };
  if (!submit) return;
  window.onblur = (e) => {
    chance--;
    if (chance < 1) {
      alert('您的切屏次数过多，将自动交卷');
      submit();
      return;
    }
    if (chance >= 1) {
      alert(`禁止切屏，${chance}次后将自动交卷`);
      e.returnValue = false;
    }
  };
};

export const noWechat = () => {
  Modal.info({
    title: '操作提醒',
    content: '请绑定您的微信账号开通培训练习操作权限，绑定成功后每次登录请使用微信登录进行培训学习',
    okText: '去绑定',
    style: { fontSize: 30, color: '#f60' },
    onOk: () => {
      location.href = `/index/index/login_weixin`;
    },
  });
  history.goBack();
};

export const checkHost = () => {
  /* 显示微信登录的 */
  const host = window.location.host;
  return (
    // host !== 'qdtzsbxh.shejiyuan.com' &&
    // host !== '192.168.0.131:8000' &&
    // host !== 'hengtai.shejiyuan.com'
    host === 'dytzsbpx.shejiyuan.com' ||
    host === 'anshun.shejiyuan.com' ||
    // ||host === 'xuexi.shejiyuan.com'
    host === 'hengtai.shejiyuan.com' ||
    host === 'tzsbpx.shejiyuan.com' ||
    host === 'qdtzsbxh.shejiyuan.com' ||
    // ||host === 'jinzhi.shejiyuan.com'
    // ||host === 'haidai.shejiyuan.com'
    // ||host === 'anping.shejiyuan.com'
    // ||host === 'tonglian.shejiyuan.com'
    host === 'ante.shejiyuan.com' ||
    host === 'zhengda.shejiyuan.com' ||
    // ||host === 'guangyuan.shejiyuan.com'
    host === 'yuanhui.shejiyuan.com' ||
    host === 'hangda.shejiyuan.com' ||
    host === 'tzzy.shejiyuan.com' ||
    host === 'hengrun.shejiyuan.com' ||
    host === 'zhongzheng.shejiyuan.com' ||
    host === 'lyxiehui.shejiyuan.com' ||
    host === 'xincheng.shejiyuan.com' ||
    // ||host === 'diantipx.shejiyuan.com'
    host === 'anquanpx.shejiyuan.com' ||
    // ||host === 'lianxi.shejiyuan.com'
    // ||host === 'haoxupx.shejiyuan.com'
    // ||host === 'binhaipx.shejiyuan.com'
    // ||host === 'haoxuexi.shejiyuan.com'
    // ||host === 'yangguangpx.shejiyuan.com'
    // ||host === 'feitianpx.shejiyuan.com'
    // ||host === 'qihangpx.shejiyuan.com'
    // ||host === 'yuchengpx.shejiyuan.com'
    // ||host === 'rongtaipx.shejiyuan.com'
    // ||host === 'dyxh.shejiyuan.com'
    // ||host === 'yalipx.shejiyuan.com'
    // ||host === 'gongmaopx.shejiyuan.com'
    // ||host === 'zhianpx.shejiyuan.com'
    // ||host === 'dykjpx.shejiyuan.com'
    // ||host === 'hongyupx.shejiyuan.com'
    // ||host === 'sftpx.shejiyuan.com'
    // ||host === 'tuopupx.shejiyuan.com'
    // ||host === 'zhiyepx.shejiyuan.com'
    // ||host === 'haiyangpx.shejiyuan.com'
    // ||host === 'dytzpx.shejiyuan.com'
    // ||host === 'sat.shejiyuan.com'
    // ||host === 'yttzpx.shejiyuan.com'
    // ||host === 'yttzpx.shejiyuan.com'
    // ||host === 'lianxi.sdwdzypx.com'
    // ||host === 'lianxi.sdzhqs.com'
    // ||host === 'xingzepx.shejiyuan.com'
    host === 'jiananpx.shejiyuan.com'
    // ||host === 'huikangpx.shejiyuan.com'
    // ||host === 'wentingpx.shejiyuan.com'
    // ||host === 'xinhuapx.shejiyuan.com'
    // ||host === 'keanpx.shejiyuan.com'
    // ||host === 'lubinpx.shejiyuan.com'
    // ||host === 'benanpx.shejiyuan.com'
    // ||host === 'juanpx.shejiyuan.com'
    // ||host === 'jinanpx.shejiyuan.com'
    // ||host === 'tongtaipx.shejiyuan.com'
    // ||host === 'hongrunpx.shejiyuan.com'
    // ||host === 'huidapx.shejiyuan.com'
    // ||host === 'huianpx.shejiyuan.com'
    // ||host === 'xinanpx.shejiyuan.com'
    // ||host === 'xinchengjs.shejiyuan.com'
    // ||host === 'boshengpx.shejiyuan.com'
    // ||host === 'hualongpx.shejiyuan.com'
    //||host === 'andapx.shejiyuan.com'
    //||host === 'hongshengpx.shejiyuan.com'
    //||host === 'zhixinpx.shejiyuan.com'
    //||host === 'huanqiupx.shejiyuan.com'
    //||host === 'huayingpx.shejiyuan.com'
    //||host === 'shankuangpx.shejiyuan.com'
    //||host === 'yzmy.shejiyuan.com'
    //||host === 'antaipx.shejiyuan.com'
    //||host === 'jingdingpx.shejiyuan.com'
    //||host === 'zhonganpx.shejiyuan.com'
    //||host === 'qiyuanpx.shejiyuan.com'
    //||host === 'zbgypx.shejiyuan.com'
    //||host === 'chaoyangpx.shejiyuan.com'
    //||host === 'zhousidunpx.shejiyuan.com'
    //||host === 'taijiepx.shejiyuan.com'
    //||host === 'zhutaipx.shejiyuan.com'
    //||host === 'zenengpx.shejiyuan.com'
    //||host === 'sanyingpx.shejiyuan.com'
    //||host === 'anshengpx.shejiyuan.com'
    //||host === 'yedapx.shejiyuan.com'
    //||host === 'hourenpx.shejiyuan.com'
    //||host === 'gmpx.shejiyuan.com'
    //||host === 'hjpx.shejiyuan.com'
    //||host === 'kypx.shejiyuan.com'
    //||host === 'shengqingpx.shejiyuan.com'
    //||host === 'yijiepx.shejiyuan.com'

    //||host === 'fangyuanpx.shejiyuan.com'
    //||host === 'lykypx.shejiyuan.com'
    //||host === 'xianglongpx.shejiyuan.com'
    //||host === 'nengyuanpx.shejiyuan.com'
    //||host === 'nanxiangpx.shejiyuan.com'
    //||host === 'baotaipx.shejiyuan.com'
    //||host === 'tengshengpx.shejiyuan.com'
    //||host === 'ankangpx.shejiyuan.com'
    //||host === 'guoyuepx.shejiyuan.com'
    //||host === 'jiandapx.shejiyuan.com'
    //||host === 'gangchengpx.shejiyuan.com'
    //||host === 'yingjipx.shejiyuan.com'
    //||host === 'yulupx.shejiyuan.com'
    //||host === 'qhzypx.shejiyuan.com'
    //||host === 'anjiapx.shejiyuan.com'
    //||host === 'pengfengpx.shejiyuan.com'
    //||host === 'anpeipx.shejiyuan.com'
    //||host === 'hongjiapx.shejiyuan.com'

    //||host === 'xiangruipx.shejiyuan.com'
    //||host === 'tsaq.shejiyuan.com'
    //||host === 'hantingpx.shejiyuan.com'
    //||host === 'yituopx.shejiyuan.com'
    //||host === 'yikangpx.shejiyuan.com'
    //||host === 'xinnuopx.shejiyuan.com'
    //||host === 'yuxiangpx.shejiyuan.com'
    //||host === 'luquanpx.shejiyuan.com'
    //||host === 'anxinpx.shejiyuan.com'
    //||host === 'gyjspx.shejiyuan.com'

    //||host === 'hetaipx.shejiyuan.com'
    //||host === 'qzjgpx.shejiyuan.com'
    //||host === 'shengzhipx.shejiyuan.com'
    //||host === 'gtkj.shejiyuan.com'

    //||host === 'qianpx.shejiyuan.com'
    //||host === 'anshunpx.shejiyuan.com'
    //||host === 'bingxinpx.shejiyuan.com'
    //||host === 'pengxiangpx.shejiyuan.com'
    //||host === 'deshengpx.shejiyuan.com'
    //||host === 'zhengxinpx.shejiyuan.com'

    //||host === 'shiyipx.shejiyuan.com'
     //||host === 'hygz.shejiyuan.com'
  );
};

export const tip = () => {
  /* 登录页立即报名的链接 */
  const host = window.location.host;
  if (host === 'dytzsbpx.shejiyuan.com') return 'dytx.shejiyuan.com';
  if (host === 'qdtzsbxh.shejiyuan.com') return 'qdxiehui.shejiyuan.com';
  if (host === 'tzsbpx.shejiyuan.com') return 'qdtzsbpx.shejiyuan.com';
  if (host === 'anshun.shejiyuan.com') return 'anshunbm.shejiyuan.com';
  if (host === 'hengtai.shejiyuan.com') return 'hengtaibm.shejiyuan.com';
  if (host === 'xuexi.shejiyuan.com') return 'baoming.shejiyuan.com';
  if (host === 'sxhgxh.shejiyuan.com') return 'sxhgbm.shejiyuan.com';
  if (host === 'jinzhi.shejiyuan.com') return 'jinzhibm.shejiyuan.com';
  if (host === 'haidai.shejiyuan.com') return 'haidaibm.shejiyuan.com';
  if (host === 'anping.shejiyuan.com') return 'anpingbm.shejiyuan.com';
  if (host === 'ante.shejiyuan.com') return 'antebm.shejiyuan.com';
  if (host === 'zhengda.shejiyuan.com') return 'zhengdabm.shejiyuan.com';
  if (host === 'tonglian.shejiyuan.com') return 'tonglianbm.shejiyuan.com';
  if (host === 'guangyuan.shejiyuan.com') return 'guangyuanbm.shejiyuan.com';
  if (host === 'yuanhui.shejiyuan.com') return 'yuanhuibm.shejiyuan.com';
  if (host === 'hangda.shejiyuan.com') return 'hangdabm.shejiyuan.com';
  if (host === 'tzzy.shejiyuan.com') return 'tzzypx.shejiyuan.com';
  if (host === 'hengrun.shejiyuan.com') return 'hengrunpx.shejiyuan.com';
  if (host === 'zhongzheng.shejiyuan.com') return 'zhongzhengpx.shejiyuan.com';
  if (host === 'lyxiehui.shejiyuan.com') return 'lytzsbpx.shejiyuan.com';
  if (host === 'xincheng.shejiyuan.com') return 'xinchengpx.shejiyuan.com';
  if (host === 'diantipx.shejiyuan.com') return 'diantixiehui.shejiyuan.com';
  if (host === 'anquanpx.shejiyuan.com') return 'anquanzb.shejiyuan.com';
  if (host === 'lianxi.shejiyuan.com') return 'tzpx.shejiyuan.com';
  if (host === 'haoxu.shejiyuan.com') return 'haoxupx.shejiyuan.com';
  if (host === 'binhaipx.shejiyuan.com') return 'binhai.shejiyuan.com';
  if (host === 'yangguangpx.shejiyuan.com') return 'yangguang.shejiyuan.com';
  if (host === 'haoxuexi.shejiyuan.com') return 'haoxue.shejiyuan.com';
  if (host === 'feitianpx.shejiyuan.com') return 'feitian.shejiyuan.com';
  if (host === 'qihangpx.shejiyuan.com') return 'qihang.shejiyuan.com';
  if (host === 'yuchengpx.shejiyuan.com') return 'yucheng.shejiyuan.com';
  if (host === 'rongtaipx.shejiyuan.com') return 'rongtai.shejiyuan.com';
  if (host === 'yalipx.shejiyuan.com') return 'yali.shejiyuan.com';
  if (host === 'dyxh.shejiyuan.com') return 'dyzlxh.shejiyuan.com';
  if (host === 'gongmaopx.shejiyuan.com') return 'gongmao.shejiyuan.com';
  if (host === 'zhianpx.shejiyuan.com') return 'zhian.shejiyuan.com';
  if (host === 'dykjpx.shejiyuan.com') return 'dykj.shejiyuan.com';
  if (host === 'hongyupx.shejiyuan.com') return 'hongyu.shejiyuan.com';
  if (host === 'sftpx.shejiyuan.com') return 'sft.shejiyuan.com';
  if (host === 'tuopupx.shejiyuan.com') return 'tuopu.shejiyuan.com';
  if (host === 'zhiyepx.shejiyuan.com') return 'zhiye.shejiyuan.com';
  if (host === 'haiyangpx.shejiyuan.com') return 'haiyang.shejiyuan.com';
  if (host === 'dytzpx.shejiyuan.com') return 'dypx.shejiyuan.com';
  if (host === 'sat.shejiyuan.com') return 'shangante.shejiyuan.com';
  if (host === 'yttzpx.shejiyuan.com') return 'yttz.shejiyuan.com';
  if (host === 'lianxi.sdwdzypx.com') return 'www.sdwdzypx.com';
  if (host === 'lianxi.sdzhqs.com') return 'www.sdzhqs.com';
  if (host === 'xingzepx.shejiyuan.com') return 'xingze.shejiyuan.com';
  if (host === 'jiananpx.shejiyuan.com') return 'jianan.shejiyuan.com';
  if (host === 'huikangpx.shejiyuan.com') return 'huikang.shejiyuan.com';
  if (host === 'wentingpx.shejiyuan.com') return 'wenting.shejiyuan.com';
  if (host === 'xinhuapx.shejiyuan.com') return 'xinhua.shejiyuan.com';
  if (host === 'keanpx.shejiyuan.com') return 'kean.shejiyuan.com';
  if (host === 'lubinpx.shejiyuan.com') return 'lubin.shejiyuan.com';
  if (host === 'benanpx.shejiyuan.com') return 'benan.shejiyuan.com';
  if (host === 'juanpx.shejiyuan.com') return 'juan.shejiyuan.com';
  if (host === 'jinanpx.shejiyuan.com') return 'jinan.shejiyuan.com';
  if (host === 'tongtaipx.shejiyuan.com') return 'tongtai.shejiyuan.com';
  if (host === 'hongrunpx.shejiyuan.com') return 'hongrun.shejiyuan.com';
  if (host === 'huidapx.shejiyuan.com') return 'huida.shejiyuan.com';
  if (host === 'huianpx.shejiyuan.com') return 'huian.shejiyuan.com';
  if (host === 'xinanpx.shejiyuan.com') return 'xinanyuan.shejiyuan.com';
  if (host === 'xinchengjs.shejiyuan.com') return 'xinchengzy.shejiyuan.com';
  if (host === 'boshengpx.shejiyuan.com') return 'bosheng.shejiyuan.com';
  if (host === 'hualongpx.shejiyuan.com') return 'hualong.shejiyuan.com';
  if (host === 'andapx.shejiyuan.com') return 'anda.shejiyuan.com';
  if (host === 'hongshengpx.shejiyuan.com') return 'hongsheng.shejiyuan.com';
  if (host === 'zhixinpx.shejiyuan.com') return 'zhixin.shejiyuan.com';
  if (host === 'huanqiupx.shejiyuan.com') return 'huanqiu.shejiyuan.com';
  if (host === 'huayingpx.shejiyuan.com') return 'huaying.shejiyuan.com';
  if (host === 'shankuangpx.shejiyuan.com') return 'shankuang.shejiyuan.com';
  if (host === 'yzmy.shejiyuan.com') return 'yz.shejiyuan.com';
  if (host === 'yutengpx.shejiyuan.com') return 'yuteng.shejiyuan.com';

  if (host === 'antaipx.shejiyuan.com') return 'antai.shejiyuan.com';
  if (host === 'jingdingpx.shejiyuan.com') return 'jingding.shejiyuan.com';
  if (host === 'zhonganpx.shejiyuan.com') return 'zhongan.shejiyuan.com';
  if (host === 'qiyuanpx.shejiyuan.com') return 'qiyuan.shejiyuan.com';
  if (host === 'zbgypx.shejiyuan.com') return 'zbgy.shejiyuan.com';
  if (host === 'chaoyangpx.shejiyuan.com') return 'chaoyang.shejiyuan.com';
  if (host === 'zhousidunpx.shejiyuan.com') return 'zhousidun.shejiyuan.com';
  if (host === 'xinghuopx.shejiyuan.com') return 'xinghuo.shejiyuan.com';
  if (host === 'taijiepx.shejiyuan.com') return 'taijie.shejiyuan.com';
  if (host === 'zhutaipx.shejiyuan.com') return 'zhutai.shejiyuan.com';
  if (host === 'zenengpx.shejiyuan.com') return 'zeneng.shejiyuan.com';
  if (host === 'sanyingpx.shejiyuan.com') return 'sanying.shejiyuan.com';

  if (host === 'anshengpx.shejiyuan.com') return 'ansheng.shejiyuan.com';
  if (host === 'yedapx.shejiyuan.com') return 'yeda.shejiyuan.com';
  if (host === 'hourenpx.shejiyuan.com') return 'houren.shejiyuan.com';
  if (host === 'gmpx.shejiyuan.com') return 'ytgm.shejiyuan.com';
  if (host === 'hjpx.shejiyuan.com') return 'sdhj.shejiyuan.com';
  if (host === 'kypx.shejiyuan.com') return 'lkky.shejiyuan.com';
  if (host === 'shengqingpx.shejiyuan.com') return 'shengqing.shejiyuan.com';
  if (host === 'yijiepx.shejiyuan.com') return 'yijie.shejiyuan.com';

  if (host === 'fangyuanpx.shejiyuan.com') return 'fangyuan.shejiyuan.com';
  if (host === 'lykypx.shejiyuan.com') return 'lyky.shejiyuan.com';
  if (host === 'xianglongpx.shejiyuan.com') return 'xianglong.shejiyuan.com';
  if (host === 'nengyuanpx.shejiyuan.com') return 'nengyuan.shejiyuan.com';
  if (host === 'nanxiangpx.shejiyuan.com') return 'nanxiang.shejiyuan.com';
  if (host === 'baotaipx.shejiyuan.com') return 'baotai.shejiyuan.com';
  if (host === 'tengshengpx.shejiyuan.com') return 'tengsheng.shejiyuan.com';

  if (host === 'ankangpx.shejiyuan.com') return 'ankang.shejiyuan.com';
  if (host === 'guoyuepx.shejiyuan.com') return 'guoyue.shejiyuan.com';
  if (host === 'jiandapx.shejiyuan.com') return 'jianda.shejiyuan.com';
  if (host === 'gangchengpx.shejiyuan.com') return 'gangcheng.shejiyuan.com';
  if (host === 'yingjipx.shejiyuan.com') return 'zqyingji.shejiyuan.com';
  if (host === 'yulupx.shejiyuan.com') return 'yulu.shejiyuan.com';
  if (host === 'qhzypx.shejiyuan.com') return 'qhzy.shejiyuan.com';
  if (host === 'anjiapx.shejiyuan.com') return 'anjia.shejiyuan.com';
  if (host === 'pengfengpx.shejiyuan.com') return 'pengfeng.shejiyuan.com';
  if (host === 'anpeipx.shejiyuan.com') return 'anpei.shejiyuan.com';
  if (host === 'hongjiapx.shejiyuan.com') return 'hongjia.shejiyuan.com';

  if (host === 'xiangruipx.shejiyuan.com') return 'xiangrui.shejiyuan.com';
  if (host === 'tsaq.shejiyuan.com') return 'tsanquan.shejiyuan.com';
  if (host === 'hantingpx.shejiyuan.com') return 'hanting.shejiyuan.com';
  if (host === 'yituopx.shejiyuan.com') return 'yituo.shejiyuan.com';
  if (host === 'yikangpx.shejiyuan.com') return 'yikang.shejiyuan.com';
  if (host === 'xinnuopx.shejiyuan.com') return 'xinnuo.shejiyuan.com';
  if (host === 'yuxiangpx.shejiyuan.com') return 'yuxiang.shejiyuan.com';
  if (host === 'luquanpx.shejiyuan.com') return 'luquan.shejiyuan.com';
  if (host === 'anxinpx.shejiyuan.com') return 'anxin.shejiyuan.com';
  if (host === 'gyjspx.shejiyuan.com') return 'gyjs.shejiyuan.com';

  if (host === 'hetaipx.shejiyuan.com') return 'hetaipx.shejiyuan.com';
  if (host === 'qzjgpx.shejiyuan.com') return 'qzjgpx.shejiyuan.com';
  if (host === 'shengzhipx.shejiyuan.com') return 'shengzhipx.shejiyuan.com';
  if (host === 'gtkj.shejiyuan.com') return 'gtaq.shejiyuan.com';

  if (host === 'qian.shejiyuan.com') return 'qianpx.shejiyuan.com';
  if (host === 'anshunpx.shejiyuan.com') return 'aqanshun.shejiyuan.com';
  if (host === 'bingxinpx.shejiyuan.com') return 'bingxin.shejiyuan.com';
  if (host === 'pengxiangpx.shejiyuan.com') return 'pengxiang.shejiyuan.com';
  if (host === 'deshengpx.shejiyuan.com') return 'desheng.shejiyuan.com';
  if (host === 'zhengxinpx.shejiyuan.com') return 'zhengxin.shejiyuan.com';
  if (host === 'shiyipx.shejiyuan.com') return 'shiyi.shejiyuan.com';
  if (host === 'hygz.shejiyuan.com') return 'ythygz.shejiyuan.com';
  return 'baoming.shejiyuan.com';
};

export const backgroundImage = () => {
  /* 登录页背景图 */
  const host = window.location.host;
  if (host === 'dytzsbpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_dy.png';
  if (host === 'qdtzsbxh.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_qdtzsbxh.png';
  if (host === 'tzsbpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_tzsbpx.png';
  if (host === 'anshun.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_anshun.png';
  if (host === 'sxhgxh.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_sxhgxh.png';
  if (host === 'hengtai.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_hengtai.png';
  if (host === 'jinzhi.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_jinzhi.png';
  if (host === 'haidai.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_haidai.png';
  if (host === 'anping.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_anping.png';
  if (host === 'ante.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_ante.png';
  if (host === 'zhengda.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_zhengda.png';
  if (host === 'tonglian.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_tonglian.png';
  if (host === 'guangyuan.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_guangyuan.png';
  if (host === 'yuanhui.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_yuanhui.png';
  if (host === 'hangda.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_hangda.png';
  if (host === 'tzzy.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_tzzy.png';
  if (host === 'hengrun.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_hengrun.png';
  if (host === 'zhongzheng.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_zhongzheng.png';
  if (host === 'lyxiehui.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_lyxiehui.png';
  if (host === 'xincheng.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_xincheng.png';
  if (host === 'diantipx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_diantixiehui.png';
  if (host === 'anquanpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_anquanpx.png';
  if (host === 'lianxi.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_lianxi.png';
  if (host === 'haoxu.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_haoxu.png';
  if (host === 'binhaipx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_binhaipx.png';
  if (host === 'haoxuexi.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_tzsbpx.png';
  if (host === 'yangguangpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_yangguangpx.png';
  if (host === 'feitianpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_feitian.png';
  if (host === 'qihangpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_qihang.png';
  if (host === 'yuchengpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_yucheng.png';
  if (host === 'rongtaipx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_rongtai.png';
  if (host === 'dyxh.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_dyxh.png';
  if (host === 'yalipx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_yali.png';
  if (host === 'gongmaopx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_gongmao.png';
  if (host === 'zhianpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_gongmao.png';
  if (host === 'sftpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_gongmao.png';
  if (host === 'hongyupx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_hongyu.png';
  if (host === 'dykjpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_dykj.png';
  if (host === 'tuopupx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_tuopu.png';
  if (host === 'zhiyepx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_zhiye.png';
  if (host === 'haiyangpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_haiyang.png';
  if (host === 'dytzpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_dytzpx.png';
  if (host === 'sat.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_sat.png';
  if (host === 'yttzpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_yttzpx.png';
  if (host === 'lianxi.sdwdzypx.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_sdwdzypx.png';
  if (host === 'lianxi.sdzhqs.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_sdzhqs.png';
  if (host === 'xingzepx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_xingzepx.png';
  if (host === 'jiananpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_jiananpx.png';
  if (host === 'huikangpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_huikangpx.png';
  if (host === 'wentingpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_wentingpx.png';
  if (host === 'xinhuapx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_xinhuapx.png';
  if (host === 'keanpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_keanpx.png';
  if (host === 'lubinpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_lubinpx.png';
  if (host === 'benanpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_benanpx.png';
  if (host === 'juanpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_juanpx.png';
  if (host === 'jinanpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_jinanpx.png';

  if (host === 'tongtaipx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_tongtaipx.png';

  if (host === 'hongrunpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_hongrunpx.png';
  if (host === 'huidapx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_huidapx.png';
  if (host === 'huianpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_huianpx.png';
  if (host === 'xinanpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_xinanpx.png';
  if (host === 'xinchengjs.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_xinchengzypx.png';
  if (host === 'boshengpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_boshengpx1.png';

  if (host === 'andapx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_andapx.png';
  if (host === 'hongshengpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_hongshengpx.png';
  if (host === 'zhixinpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_zhixinpx.png';
  if (host === 'huanqiupx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_huanqiupx.png';
  if (host === 'huayingpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_huayingpx.png';
  if (host === 'shankuangpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_shankuangpx.png';
  if (host === 'yzmy.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_yzmypx.png';
  if (host === 'yutengpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_yutengpx.png';

  if (host === 'antaipx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_antaipx.png';
  if (host === 'jingdingpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_jingdingpx.png';
  if (host === 'zhonganpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_zhonganpx.png';
  if (host === 'qiyuanpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_qiyuanpx.png';
  if (host === 'zbgypx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_zbgypx.png';
  if (host === 'chaoyangpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_chaoyangpx.png';
  if (host === 'zhousidunpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_zhousidunpx.png';
  if (host === 'xinghuopx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_xinghuopx.png';

  if (host === 'taijiepx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_taijiepx.png';
  if (host === 'zhutaipx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_zhutaipx.png';
  if (host === 'zenengpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_zenengpx.png';
  if (host === 'sanyingpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_sanyingpx1.png';

  if (host === 'anshengpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_anshengpx.png';
  if (host === 'yedapx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_yedapx.png';
  if (host === 'hourenpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_hourenpx.png';
  if (host === 'gmpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_gmpx.png';
  if (host === 'hjpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_hjpx.png';
  if (host === 'kypx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_kypx.png';
  if (host === 'shengqingpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_shengqingpx.png';
  if (host === 'yijiepx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_yijiepx.png';

  if (host === 'fangyuanpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_fangyuanpx.png';
  if (host === 'lykypx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_lykypx.png';
  if (host === 'xianglongpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_xianglongpx.png';
  if (host === 'nengyuanpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_nengyuanpx.png';
  if (host === 'nanxiangpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_nanxiangpx.png';

  if (host === 'baotaipx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_baotaipx.png';
  if (host === 'tengshengpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_tengshengpx.png';

  if (host === 'ankangpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_ankangpx.png';
  if (host === 'guoyuepx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_guoyuepx.png';
  if (host === 'jiandapx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_jiandapx.png';
  if (host === 'gangchengpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_gangchengpx.png';
  if (host === 'yingjipx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_yingjipx.png';
  if (host === 'yulupx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_yulupx.png';
  if (host === 'qhzypx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_qhzypx.png';
  if (host === 'anjiapx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_anjiapx.png';
  if (host === 'pengfengpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_pengfengpx.png';
  if (host === 'anpeipx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_anpeipx.png';
  if (host === 'hongjiapx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_hongjiapx.png';

  if (host === 'xiangruipx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_xiangruipx.png';
  if (host === 'tsaq.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_tsaqpx.png';
  if (host === 'hantingpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_hantingpx.png';
  if (host === 'yituopx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_yituopx.png';
  if (host === 'yikangpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_yikangpx.png';
  if (host === 'xinnuopx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_xinnuopx.png';
  if (host === 'yuxiangpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_yuxiangpx.png';
  if (host === 'luquanpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_luquanpx.png';
  if (host === 'anxinpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_anxinpx.png';
  if (host === 'gyjspx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_gyjspx.png';

  if (host === 'hetaipx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_hetaipx.png';
  if (host === 'qzjgpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_qzjgpx.png';
  if (host === 'shengzhipx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_shengzhipx.png';
  if (host === 'gtkj.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_gtkj.png';

  if (host === 'qianpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_qianpx.png';
  if (host === 'anshunpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_anshunpx.png';
  if (host === 'bingxinpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_bingxinpx.png';
  if (host === 'pengxiangpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_pengxiangpx.png';
  if (host === 'deshengpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_deshengpx.png';
  if (host === 'zhengxinpx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_zhengxinpx.png';

    if (host === 'shiyipx.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_shiyipx.png';

    if (host === 'hygz.shejiyuan.com')
    return 'https://www.shejiyuan.com/Public/images/exam_login_hygzpx.png';
  return 'https://www.shejiyuan.com/Public/images/exam_login.png';
};

export const hasNotice = () => {
  //有公告管理权限的
  const host = window.location.host;
  if (
    host === '192.168.0.131:8000' ||
    host === 'xuexi.shejiyuan.com' ||
    host === 'jinzhi.shejiyuan.com' ||
    host === 'zhengda.shejiyuan.com' ||
    host === 'yuanhui.shejiyuan.com' ||
    host === 'hangda.shejiyuan.com' ||
    host === 'tzzy.shejiyuan.com' ||
    host === 'hengrun.shejiyuan.com' ||
    host === 'zhongzheng.shejiyuan.com' ||
    host === 'lyxiehui.shejiyuan.com' ||
    host === 'xincheng.shejiyuan.com' ||
    host === 'diantipx.shejiyuan.com' ||
    host === 'anquanpx.shejiyuan.com' ||
    host === 'tzpx.shejiyuan.com' ||
    host === 'lianxi.shejiyuan.com' ||
    host === 'yangguangpx.shejiyuan.com' ||
    host === 'haoxuexi.shejiyuan.com' ||
    host === 'feitianpx.shejiyuan.com' ||
    host === 'qihangpx.shejiyuan.com' ||
    host === 'yuchengpx.shejiyuan.com' ||
    host === 'dyxh.shejiyuan.com' ||
    host === 'rongtaipx.shejiyuan.com' ||
    host === 'yalipx.shejiyuan.com' ||
    host === 'tuopupx.shejiyuan.com' ||
    host === 'dytzpx.shejiyuan.com' ||
    host === 'sat.shejiyuan.com' ||
    host === 'yttzpx.shejiyuan.com' ||
    host === 'lianxi.sdwdzypx.com' ||
    host === 'lianxi.sdzhqs.com' ||
    host === 'xingzepx.shejiyuan.com' ||
    host === 'jiananpx.shejiyuan.com' ||
    host === 'huikangpx.shejiyuan.com' ||
    host === 'wentingpx.shejiyuan.com' ||
    host === 'xinhuapx.shejiyuan.com' ||
    host === 'keanpx.shejiyuan.com' ||
    host === 'lubinpx.shejiyuan.com' ||
    host === 'benanpx.shejiyuan.com' ||
    host === 'juanpx.shejiyuan.com' ||
    host === 'jinanpx.shejiyuan.com' ||
    host === 'tongtaipx.shejiyuan.com' ||
    host === 'hongrunpx.shejiyuan.com' ||
    host === 'huidapx.shejiyuan.com' ||
    host === 'huianpx.shejiyuan.com' ||
    host === 'xinanpx.shejiyuan.com' ||
    host === 'xinchengjs.shejiyuan.com' ||
    host === 'boshengpx.shejiyuan.com' ||
    host === 'hualongpx.shejiyuan.com' ||
    host === 'andapx.shejiyuan.com' ||
    host === 'hongshengpx.shejiyuan.com' ||
    host === 'zhixinpx.shejiyuan.com' ||
    host === 'huanqiupx.shejiyuan.com' ||
    host === 'huayingpx.shejiyuan.com' ||
    host === 'shankuangpx.shejiyuan.com' ||
    host === 'yzmy.shejiyuan.com' ||
    host === 'yutengpx.shejiyuan.com' ||
    host === 'antaipx.shejiyuan.com' ||
    host === 'jingdingpx.shejiyuan.com' ||
    host === 'zhonganpx.shejiyuan.com' ||
    host === 'qiyuanpx.shejiyuan.com' ||
    host === 'zbgypx.shejiyuan.com' ||
    host === 'chaoyangpx.shejiyuan.com' ||
    host === 'zhousidunpx.shejiyuan.com' ||
    host === 'xinghuopx.shejiyuan.com' ||
    host === 'taijiepx.shejiyuan.com' ||
    host === 'zhutaipx.shejiyuan.com' ||
    host === 'zenengpx.shejiyuan.com' ||
    host === 'sanyingpx.shejiyuan.com' ||
    host === 'anshengpx.shejiyuan.com' ||
    host === 'yedapx.shejiyuan.com' ||
    host === 'hourenpx.shejiyuan.com' ||
    host === 'gmpx.shejiyuan.com' ||
    host === 'hjpx.shejiyuan.com' ||
    host === 'kypx.shejiyuan.com' ||
    host === 'shengqingpx.shejiyuan.com' ||
    host === 'yijiepx.shejiyuan.com' ||
    host === 'nanxiangpx.shejiyuan.com' ||
    host === 'nengyuanpx.shejiyuan.com' ||
    host === 'xianglongpx.shejiyuan.com' ||
    host === 'lykypx.shejiyuan.com' ||
    host === 'fangyuanpx.shejiyuan.com' ||
    host === 'baotaipx.shejiyuan.com' ||
    host === 'tengshengpx.shejiyuan.com' ||
    host === 'ankangpx.shejiyuan.com' ||
    host === 'guoyuepx.shejiyuan.com' ||
    host === 'jiandapx.shejiyuan.com' ||
    host === 'gangchengpx.shejiyuan.com' ||
    host === 'yingjipx.shejiyuan.com' ||
    host === 'yulupx.shejiyuan.com' ||
    host === 'qhzypx.shejiyuan.com' ||
    host === 'anjiapx.shejiyuan.com' ||
    host === 'pengfengpx.shejiyuan.com' ||
    host === 'anpeipx.shejiyuan.com' ||
    host === 'hongjiapx.shejiyuan.com' ||
    host === 'xiangruipx.shejiyuan.com' ||
    host === 'tsaq.shejiyuan.com' ||
    host === 'hantingpx.shejiyuan.com' ||
    host === 'yituopx.shejiyuan.com' ||
    host === 'yikangpx.shejiyuan.com' ||
    host === 'xinnuopx.shejiyuan.com' ||
    host === 'yuxiangpx.shejiyuan.com' ||
    host === 'luquanpx.shejiyuan.com' ||
    host === 'anxinpx.shejiyuan.com' ||
    host === 'gyjspx.shejiyuan.com' ||
    host === 'hetaipx.shejiyuan.com' ||
    host === 'qzjgpx.shejiyuan.com' ||
    host === 'shengzhipx.shejiyuan.com' ||
    host === 'gtkj.shejiyuan.com' ||
    host === 'qianpx.shejiyuan.com' ||
    host === 'anshunpx.shejiyuan.com' ||
    host === 'bingxinpx.shejiyuan.com' ||
    host === 'pengxiangpx.shejiyuan.com' ||
    host === 'deshengpx.shejiyuan.com' ||
    host === 'zhengxinpx.shejiyuan.com'||
    host === 'shiyipx.shejiyuan.com'||
    host === 'hygz.shejiyuan.com'
  )
    return true;
  return false;
};
export const isZhengda = () => {
  //正大定制化需求
  const host = window.location.host;
  if (host === 'zhengda.shejiyuan.com' || host === '192.168.0.131:8000') return true;
  return false;
};
export const isZhongZheng = () => {
  //中正定制化需求
  const host = window.location.host;
  if (
    host === 'zhongzheng.shejiyuan.com'
    // ||host==='192.168.0.131:8000'
  )
    return true;
  return false;
};
export const isBinhai = () => {
  //滨海合一般工贸、志安定制化需求
  const host = window.location.host;
  if (
    host === 'binhaipx.shejiyuan.com' ||
    host === '192.168.0.131:8000' ||
    host === 'gongmaopx.shejiyuan.com' ||
    host === 'sftpx.shejiyuan.com' ||
    host === 'zhianpx.shejiyuan.com' ||
    host === 'tuopupx.shejiyuan.com' ||
    host === 'luquanpx.shejiyuan.com' ||
    host === 'anxinpx.shejiyuan.com'
  )
    return true;
  return false;
};

export const isJianan = () => {
  //捡安定制化需求
  const host = window.location.host;
  if (host === 'jiananpx.shejiyuan.com') return true;
  return false;
};
export const isKean = () => {
  //科安定制化需求
  const host = window.location.host;
  if (host === 'keanpx.shejiyuan.com' || host === '192.168.0.131:8000') return true;
  return false;
};

export const isOnlyBinhai = () => {
  //滨海制化需求
  const host = window.location.host;
  if (host === 'binhaipx.shejiyuan.com') return true;
  return false;
};
export const isAnte = () => {
  //安特定制化需求
  const host = window.location.host;
  if (host === 'ante.shejiyuan.com') return true;
  return false;
};
export const isHangda = () => {
  //航达定制化需求
  const host = window.location.host;
  if (host === 'hangda.shejiyuan.com') return true;
  return false;
};
export const isHaoxuexi = () => {
  //好学习定制化需求
  const host = window.location.host;
  if (host === 'haoxuexi.shejiyuan.com') return true;
  return false;
};

export const isTzsbpx = () => {
  //黄岛定制化
  const host = window.location.host;
  if (host === 'tzsbpx.shejiyuan.com') return true;
  return false;
};
export const isHengTai = () => {
  //恒泰定制化
  const host = window.location.host;
  if (host === 'hengtai.shejiyuan.com') return true;
  return false;
};
export const isLyxiehui = () => {
  //临沂定制化
  const host = window.location.host;
  if (host === 'lyxiehui.shejiyuan.com') return true;
  return false;
};
export const isAnquanpx = () => {
  //淄博安全定制化
  const host = window.location.host;
  if (host === 'anquanpx.shejiyuan.com') return true;
  return false;
};
export const isXinchengJs = () => {
  //东营信诚
  const host = window.location.host;
  if (host === 'xinchengjs.shejiyuan.com') return true;
  return false;
};
export const isXincheng = () => {
  //信诚安全定制化
  const host = window.location.host;
  if (host === 'xincheng.shejiyuan.com') return true;
  return false;
};
export const isBosheng = () => {
  //博胜安全定制化
  const host = window.location.host;
  if (host === 'boshengpx.shejiyuan.com') return true;
  return false;
};

export const isXinhua = () => {
  //新华安全定制化
  const host = window.location.host;
  if (host === 'xinhuapx.shejiyuan.com') return true;
  return false;
};
export const isJuan = () => {
  //新华安全定制化
  const host = window.location.host;
  if (host === 'juanpx.shejiyuan.com') return true;
  return false;
};
export const isCeshi = () => {
  //新华安全定制化
  const host = window.location.host;
  if (host === 'localhost:8000') return true;
  return false;
};
export const isAqanshun = () => {
  //新华安全定制化
  const host = window.location.host;
  if (host === 'anshunpx.shejiyuan.com') return true;
  return false;
};
export const isTuopu = () => {
  //新华安全定制化
  const host = window.location.host;
  if (host === 'tuopupx.shejiyuan.com') return true;
  return false;
};
export const isZhiye = () => {
  //西海岸职业
  const host = window.location.host;
  if (host === 'zhiyepx.shejiyuan.com') return true;
  return false;
};
export const hasSignUp = () => {
  //首页有注册入口的
  const host = window.location.host;
  return true;
  return false;
};

export const hasApply = () => {
  //申请表管理的
  const host = window.location.host;
  if (
    host === 'xuexi.shejiyuan.com' ||
    host === '192.168.0.131:8000' ||
    host === 'yuanhui.shejiyuan.com'
  )
    return true;
  return false;
};
export const hasIsSw = () => {
  const is_sw = JSON.parse(localStorage.getItem('userinfo') || '{}').is_sw;
  if (Number(is_sw) === Number(is_sw)) return true;
  return false;
};
export const isLianxi = () => {
  //是否是特种作业平台，如果只有特种作业，就在这里加上，一般工贸也属于特种作业
  const host = window.location.host;
  const is_sw = JSON.parse(localStorage.getItem('userinfo') || '{}').is_sw;
  if (
    host === 'lianxi.shejiyuan.com' ||
    host === 'binhaipx.shejiyuan.com' ||
    host === 'yalipx.shejiyuan.com' ||
    host === 'sftpx.shejiyuan.com' ||
    host === 'tuopupx.shejiyuan.com' ||
    host === 'haiyangpx.shejiyuan.com' ||
    host === '192.168.0.131:8000' ||
    host === 'huikangpx.shejiyuan.com' ||
    host === 'wentingpx.shejiyuan.com' ||
    host === 'lubinpx.shejiyuan.com' ||
    host === 'benanpx.shejiyuan.com' ||
    host === 'juanpx.shejiyuan.com' ||
    host === 'jinanpx.shejiyuan.com' ||
    host === 'tongtaipx.shejiyuan.com' ||
    host === 'hongrunpx.shejiyuan.com' ||
    host === 'huidapx.shejiyuan.com' ||
    host === 'huianpx.shejiyuan.com' ||
    host === 'xinanpx.shejiyuan.com' ||
    host === 'xinchengjs.shejiyuan.com' ||
    host === 'andapx.shejiyuan.com' ||
    host === 'hongshengpx.shejiyuan.com' ||
    host === 'huayingpx.shejiyuan.com' ||
    host === 'shankuangpx.shejiyuan.com' ||
    host === 'yzmy.shejiyuan.com' ||
    host === 'jingdingpx.shejiyuan.com' ||
    host === 'zhousidunpx.shejiyuan.com' ||
    host === 'xinghuopx.shejiyuan.com' ||
    host === 'zenengpx.shejiyuan.com' ||
    host === 'sanyingpx.shejiyuan.com' ||
    host === 'anshengpx.shejiyuan.com' ||
    host === 'yedapx.shejiyuan.com' ||
    host === 'hourenpx.shejiyuan.com' ||
    host === 'gmpx.shejiyuan.com' ||
    host === 'hjpx.shejiyuan.com' ||
    host === 'kypx.shejiyuan.com' ||
    host === 'shengqingpx.shejiyuan.com' ||
    host === 'nanxiangpx.shejiyuan.com' ||
    host === 'nengyuanpx.shejiyuan.com' ||
    host === 'xianglongpx.shejiyuan.com' ||
    host === 'lykypx.shejiyuan.com' ||
    host === 'baotaipx.shejiyuan.com' ||
    host === 'ankangpx.shejiyuan.com' ||
    host === 'guoyuepx.shejiyuan.com' ||
    host === 'jiandapx.shejiyuan.com' ||
    host === 'gangchengpx.shejiyuan.com' ||
    host === 'yingjipx.shejiyuan.com' ||
    host === 'yulupx.shejiyuan.com' ||
    host === 'qhzypx.shejiyuan.com' ||
    host === 'anjiapx.shejiyuan.com' ||
    host === 'pengfengpx.shejiyuan.com' ||
    host === 'anpeipx.shejiyuan.com' ||
    host === 'hongjiapx.shejiyuan.com' ||
    host === 'tsaq.shejiyuan.com' ||
    host === 'hantingpx.shejiyuan.com' ||
    host === 'yituopx.shejiyuan.com' ||
    host === 'yikangpx.shejiyuan.com' ||
    host === 'xinnuopx.shejiyuan.com' ||
    host === 'yuxiangpx.shejiyuan.com' ||
    host === 'gyjspx.shejiyuan.com' ||
    host === 'hetaipx.shejiyuan.com' ||
    host === 'qzjgpx.shejiyuan.com' ||
    host === 'shengzhipx.shejiyuan.com' ||
    host === 'qianpx.shejiyuan.com' ||
    host === 'anshunpx.shejiyuan.com' ||
    host === 'bingxinpx.shejiyuan.com' ||
    host === 'pengxiangpx.shejiyuan.com' ||
    host === 'deshengpx.shejiyuan.com' ||
    host === 'zhengxinpx.shejiyuan.com' ||
    host === 'hygz.shejiyuan.com'||
    is_sw * 1 === 1
  )
    return true;
  return false;
};
export const isLianxiSite = () => {
  //是否是只有特种作业的平台 如果只有特种作业，就在这里加上，一般工贸也属于特种作业，但是如果特种设备和特种作业同时开启，就不需要放在这里了
  const host = window.location.host;
  if (
    host === 'lianxi.shejiyuan.com' ||
    host === 'binhaipx.shejiyuan.com' ||
    host === 'sftpx.shejiyuan.com' ||
    host === 'yalipx.shejiyuan.com' ||
    host === 'tuopupx.shejiyuan.com' ||
    host === '192.168.0.131:8000' ||
    host === 'haiyangpx.shejiyuan.com' ||
    host === 'huikangpx.shejiyuan.com' ||
    host === 'wentingpx.shejiyuan.com' ||
    host === 'lubinpx.shejiyuan.com' ||
    host === 'benanpx.shejiyuan.com' ||
    host === 'juanpx.shejiyuan.com' ||
    host === 'jinanpx.shejiyuan.com' ||
    host === 'tongtaipx.shejiyuan.com' ||
    host === 'hongrunpx.shejiyuan.com' ||
    host === 'huidapx.shejiyuan.com' ||
    host === 'huianpx.shejiyuan.com' ||
    host === 'xinanpx.shejiyuan.com' ||
    host === 'xinchengjs.shejiyuan.com' ||
    host === 'andapx.shejiyuan.com' ||
    host === 'hongshengpx.shejiyuan.com' ||
    host === 'huayingpx.shejiyuan.com' ||
    host === 'shankuangpx.shejiyuan.com' ||
    host === 'yzmy.shejiyuan.com' ||
    host === 'jingdingpx.shejiyuan.com' ||
    host === 'zhousidunpx.shejiyuan.com' ||
    host === 'xinghuopx.shejiyuan.com' ||
    host === 'zenengpx.shejiyuan.com' ||
    host === 'sanyingpx.shejiyuan.com' ||
    host === 'anshengpx.shejiyuan.com' ||
    host === 'yedapx.shejiyuan.com' ||
    host === 'hourenpx.shejiyuan.com' ||
    host === 'gmpx.shejiyuan.com' ||
    host === 'hjpx.shejiyuan.com' ||
    host === 'kypx.shejiyuan.com' ||
    host === 'shengqingpx.shejiyuan.com' ||
    host === 'nanxiangpx.shejiyuan.com' ||
    host === 'nengyuanpx.shejiyuan.com' ||
    host === 'xianglongpx.shejiyuan.com' ||
    host === 'lykypx.shejiyuan.com' ||
    host === 'baotaipx.shejiyuan.com' ||
    host === 'ankangpx.shejiyuan.com' ||
    host === 'guoyuepx.shejiyuan.com' ||
    host === 'jiandapx.shejiyuan.com' ||
    host === 'gangchengpx.shejiyuan.com' ||
    host === 'yingjipx.shejiyuan.com' ||
    host === 'yulupx.shejiyuan.com' ||
    host === 'qhzypx.shejiyuan.com' ||
    host === 'anjiapx.shejiyuan.com' ||
    host === 'pengfengpx.shejiyuan.com' ||
    host === 'anpeipx.shejiyuan.com' ||
    host === 'hongjiapx.shejiyuan.com' ||
    host === 'tsaq.shejiyuan.com' ||
    host === 'hantingpx.shejiyuan.com' ||
    host === 'yituopx.shejiyuan.com' ||
    host === 'yikangpx.shejiyuan.com' ||
    host === 'xinnuopx.shejiyuan.com' ||
    host === 'yuxiangpx.shejiyuan.com' ||
    host === 'gyjspx.shejiyuan.com' ||
    host === 'hetaipx.shejiyuan.com' ||
    host === 'qzjgpx.shejiyuan.com' ||
    host === 'shengzhipx.shejiyuan.com' ||
    host === 'qianpx.shejiyuan.com' ||
    host === 'anshunpx.shejiyuan.com' ||
    host === 'bingxinpx.shejiyuan.com' ||
    host === 'pengxiangpx.shejiyuan.com' ||
    host === 'deshengpx.shejiyuan.com' ||
    host === 'zhengxinpx.shejiyuan.com'||
    host === 'hygz.shejiyuan.com'
  )
    return true;
  return false;
};
export const isDevelopment = () => {
  //未上线的功能专用
  const host = window.location.host;
  if (host === 'xuexi.shejiyuan.com' || host === '192.168.0.131:8000') return true;
  return false;
};
export const hasSend = () => {
  //有微信推送的
  const host = window.location.host;
  if (host === 'zhengda.shejiyuan.com') return true;
  if (host === 'qdtzsbxh.shejiyuan.com') return true;
  return false;
};
export const minutesToHours = (time: any) => {
  if (!time) return '0小时0分钟';
  time = time / 1000 / 60;
  const hours = Math.floor(time / 60);
  const minutes = String(
    Math.floor(60 * Number((Number((time / 60).toFixed(2)) - Math.floor(time / 60)).toFixed(2))),
  ).replace('0.', '');
  return hours + '小时' + minutes + '分钟';
};
export const formatDuring = (mss: any) => {
  if (!mss) return '0小时0分钟';
  var hours = parseInt((mss % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
  var minutes = parseInt((mss % (1000 * 60 * 60)) / (1000 * 60));
  return hours + '小时' + minutes + '分钟';
};

export const isCustome = () => {
  //有自己题库的
  const host = window.location.host;
  if (
    host === 'yalipx.shejiyuan.com' ||
    host === 'hangda.shejiyuan.com' ||
    host === 'zhiye.shejiyuan.com' ||
    host === 'yuchengpx.shejiyuan.com' ||
    host === 'huikangpx.shejiyuan.com' ||
    host === 'wentingpx.shejiyuan.com' ||
    host === 'xinhuapx.shejiyuan.com' ||
    host === 'keanpx.shejiyuan.com'
    // ||host === '192.168.0.131:8000'
  )
    return true;
};
export const isCustomeSubject = (id) => {
  //自己题库的id
  const host = window.location.host;
  if (
    (host === 'zhiyepx.shejiyuan.com' ||
      host === '192.168.0.131:8000' ||
      host === 'keanpx.shejiyuan.com' ||
      host === 'xinhuapx.shejiyuan.com') &&
    (Number(id) === 251 ||
      Number(id) === 252 ||
      Number(id) === 253 ||
      Number(id) === 254 ||
      Number(id) === 144 ||
      Number(id) === 145)
  ) {
    return true;
  }

  if (Number(id) === 251 || Number(id) === 252) return true;
  return false;
};
export const hasLearnTime = () => {
  // 是否含有学时
  const host = window.location.host;
  if (
    host === 'hongjiapx.shejiyuan.com' ||
    host === 'xiangruipx.shejiyuan.com' ||
    host === 'tsaq.shejiyuan.com' ||
    host === 'hantingpx.shejiyuan.com' ||
    host === 'yituopx.shejiyuan.com' ||
    host === 'yikangpx.shejiyuan.com' ||
    host === 'xinnuopx.shejiyuan.com' ||
    host === 'yuxiangpx.shejiyuan.com' ||
    host === 'luquanpx.shejiyuan.com' ||
    host === 'anxinpx.shejiyuan.com' ||
    host === 'gyjspx.shejiyuan.com' ||
    host === 'hetaipx.shejiyuan.com' ||
    host === 'qzjgpx.shejiyuan.com' ||
    host === 'shengzhipx.shejiyuan.com' ||
    host === 'gtkj.shejiyuan.com' ||
    host === 'qianpx.shejiyuan.com' ||
    host === 'anshunpx.shejiyuan.com' ||
    host === 'bingxinpx.shejiyuan.com' ||
    host === 'pengxiangpx.shejiyuan.com' ||
    host === 'deshengpx.shejiyuan.com' ||
    host === 'zhengxinpx.shejiyuan.com'||
    host === 'shiyipx.shejiyuan.com'||
    host === 'hygz.shejiyuan.com'
  )
    return true;
  return false;
};
export const hasProgressFunc = () => {
  //有进度条的，一般工贸基本上都需要，按需加上
  const subject = JSON.parse(localStorage.getItem('userinfo') || '{}').subject;
  const host = window.location.host;
  if (
    host === 'localhost:8000' ||
    host === '192.168.0.131:8000' ||
    host === 'binhaipx.shejiyuan.com' ||
    host === 'gongmaopx.shejiyuan.com' ||
    host === 'yalipx.shejiyuan.com' ||
    host === 'hangda.shejiyuan.com' ||
    host === 'zhianpx.shejiyuan.com' ||
    host === 'sftpx.shejiyuan.com' ||
    host === 'tuopupx.shejiyuan.com' ||
    host === 'keanpx.shejiyuan.com' ||
    host === 'juanpx.shejiyuan.com' ||
    host === 'xinchengjs.shejiyuan.com' ||
    host === 'hongjiapx.shejiyuan.com' ||
    host === 'xiangruipx.shejiyuan.com' ||
    host === 'tsaq.shejiyuan.com' ||
    host === 'hantingpx.shejiyuan.com' ||
    host === 'yituopx.shejiyuan.com' ||
    host === 'yikangpx.shejiyuan.com' ||
    host === 'xinnuopx.shejiyuan.com' ||
    host === 'yuxiangpx.shejiyuan.com' ||
    host === 'luquanpx.shejiyuan.com' ||
    host === 'anxinpx.shejiyuan.com' ||
    host === 'gyjspx.shejiyuan.com' ||
    host === 'hetaipx.shejiyuan.com' ||
    host === 'qzjgpx.shejiyuan.com' ||
    host === 'shengzhipx.shejiyuan.com' ||
    host === 'gtkj.shejiyuan.com' ||
    host === 'qianpx.shejiyuan.com' ||
    host === 'anshunpx.shejiyuan.com' ||
    host === 'bingxinpx.shejiyuan.com' ||
    host === 'pengxiangpx.shejiyuan.com' ||
    host === 'deshengpx.shejiyuan.com' ||
    host === 'zhengxinpx.shejiyuan.com'||
    host === 'shiyipx.shejiyuan.com'||
    host === 'hygz.shejiyuan.com'
  ) {
    return true;
  }
  if (
    (host === 'huikangpx.shejiyuan.com' ||
      host === 'wentingpx.shejiyuan.com' ||
      host === 'xinhuapx.shejiyuan.com') &&
    (subject.includes(251) || subject.includes(252))
  ) {
    return true;
  }
  if (
    (host === 'zhiyepx.shejiyuan.com' ||
      host === 'keanpx.shejiyuan.com' ||
      host === 'juanpx.shejiyuan.com') &&
    (subject.includes(251) ||
      subject.includes(252) ||
      subject.includes(253) ||
      subject.includes(254))
  ) {
    return true;
  }
};
export const stopExamIfTimeNotEnough = () => {
  //如果学时不够就不让练的
  const host = window.location.host;
  // if (host === 'gongmaopx.shejiyuan.com') return true;
  if (host === 'juanpx.shejiyuan.com') return true;
  // if (host === 'localhost:8000') return true;
  return false;
};
export const learnTimeRate = () => {
  //多长时间算一个学时
  const host = window.location.host;
  if (host === 'binhaipx.shejiyuan.com') {
    return 60 / 30;
  }
  if (host === 'keanpx.shejiyuan.com') {
    return 60 / 40;
  }
  if (host === 'juanpx.shejiyuan.com') {
    return 60 / 40;
  }
  if (host === 'tuopupx.shejiyuan.com') {
    return 60 / 60;
  }
  if (host === 'yituopx.shejiyuan.com') {
    return 60 / 40;
  }
  if (host === 'localhost:8000') {
    return 60 / 40;
  }
  return 60 / 60;
};

//这里是定制学时
export const learnTime = () => {
  //学时
  const host = window.location.host;
  if (host === 'hangda.shejiyuan.com') {
    return 24 * learnTimeRate();
  }
  if (host === 'tuopupx.shejiyuan.com') {
    return 16 * learnTimeRate();
  }
  if (host === 'binhaipx.shejiyuan.com') {
    return 16 * learnTimeRate();
  }
  // if (host === 'juanpx.shejiyuan.com') {
  //   return 8 * learnTimeRate();
  // }
  // if (host === "keanpx.shejiyuan.com") {
  //   return 8 * learnTimeRate();
  // }

  const subject = JSON.parse(localStorage.getItem('userinfo') || '{}').subject;

  if (host === 'juanpx.shejiyuan.com' && (subject.includes(251) || subject.includes(252))) {
    return Math.ceil(16 * learnTimeRate());
  }
  //居安复级考试定制时间
  if (host === 'juanpx.shejiyuan.com' && (subject.includes(258) || subject.includes(259))) {
    return Math.ceil(10.6666667 * learnTimeRate());
  }
  
   //益拓初级考试定制时间
   if (host === 'yituopx.shejiyuan.com' && (subject.includes(251) || subject.includes(252))) {
    return Math.ceil(21.333333 * learnTimeRate());
  }
  //益拓复级考试定制时间
  if (host === 'yituopx.shejiyuan.com' && (subject.includes(255) || subject.includes(256))) {
    return 8 * learnTimeRate();
  }
  if (host === 'yituopx.shejiyuan.com' && (subject.includes(146) || subject.includes(147))) {
    return Math.ceil(32 * learnTimeRate());
  }
  if (host === 'yituopx.shejiyuan.com' && (subject.includes(257) || subject.includes(258))) {
    return Math.ceil(10.6666 * learnTimeRate());
  }

  //科安初级考试定制时间
  if (host === 'keanpx.shejiyuan.com' && (subject.includes(251) || subject.includes(252))) {
    return Math.ceil(21.333333 * learnTimeRate());
  }
  //科安复级考试定制时间
  if (host === 'keanpx.shejiyuan.com' && (subject.includes(253) || subject.includes(254))) {
    return 8 * learnTimeRate();
  }

  return Math.ceil(12 * learnTimeRate());
};

export const countLearnTime = (time: number) => {
  //计算当前学时
  if (!time) return 0;
  return Number((time / 60).toFixed(2)) * learnTimeRate();
};
export const countLearnTimeWithHour = (time: number) => {
  //计算当前学时
  if (!time) return 0;
  return Number(time.toFixed(2)) * learnTimeRate();
};

export const hasCompany = () => {
  /* 人员管理有公司的 */
  return isZhengda() || isBinhai() || isHaoxuexi() || isAnquanpx() || isJianan() || isAnte();
};
